<html xmlns:th="http://www.thymeleaf.org">
<head>
    <link rel="stylesheet" href="./css/bootstrap.css"/>
    <script src="./js/jquery-3.2.1.min.js" type="text/javascript"></script>
    <script type="text/javascript" th:inline="javascript">
        /*<![CDATA[*/
        $(document).ready(function () {
            $("#agree").click();
            $("#confirmationForm").submit();
        });
        /*]]>*/
    </script>
</head>
<body>
<div class="container" style="display: none">
    <h2>请确认</h2>

    <p>
        Do you authorize "
        <span th:text="${authorizationRequest.clientId}"></span>
        " at "<span th:text="${authorizationRequest.redirectUri}"></span>" to access your
        protected resources
        with scope <span th:text="${authorizationRequest.scope}"></span>.
    </p>
    <form id='confirmationForm' name='confirmationForm' action='authorize' method='post'>
        <input name='user_oauth_approval' value='true' type='hidden'/>
        <input type="hidden" id="csrf_token" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
        <ul>
                <li th:each="scope : ${authorizationRequest.scope}">
                    <div class='form-group'>
                        <span th:text="${scope}"></span>
                        权限:
                        <input type='radio' th:name='${scope}' value='true' id="agree">同意</input>
                        <input type='radio' th:name='${scope}' value='false' checked>拒绝</input>
                    </div>
                </li>
            <label><input name='authorize' value='授权' type='submit' id="btn-submit"/></label>
        </ul>
    </form>


</div>
</body>
</html>